﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Nizm0.QOT.Library.Objects
{
    [Serializable]
    [XmlRoot("ExternalProject")]
    public class ExternalProject
    {
        public ExternalProject()
        { }

        public ExternalProject(string project)
        {
            Project = project;
        }

        [XmlAttribute("Project")]
        public string Project;

        [XmlArray("FieldsNames"),XmlArrayItem(typeof(string))]
        public List<string> FieldsNames = new List<string>();

        [XmlArray("Fields"), XmlArrayItem(typeof(Field))]
        public List<Field> Fields = new List<Field>();

        //public List<IProcedure> ProcedureList = new List<IProcedure>();


        public override string ToString()
        {
            return this.Project;
        }
    }

    [Serializable]
    [XmlRoot("Field")]
    public class Field
    {
        public Field()
        { }

        [XmlAttribute("Name")]
        public string Name;
        [XmlAttribute("Value")]
        public string Value;

        public override string ToString()
        {
            return string.Format("[{0}] {1}", this.Name, this.Value);
        }
    }
}
